﻿<UserControl x:Class="LFSRecord2.View.MediaStructures.MediaObjectView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:lfsconv="clr-namespace:LFSRecord2.View.Converters"
             mc:Ignorable="d" Loaded="UserControl_Loaded"
             d:DesignHeight="40" d:DesignWidth="250">
    <UserControl.Resources>
        <lfsconv:LabelSelectionBackgroundBrushConverter x:Key="labelSelectionBackgroundBrushConverter" />
        <lfsconv:LabelSelectionForegroundBrushConverter x:Key="labelSelectionForegroundBrushConverter" />
        <lfsconv:FilePathToNameConverter x:Key="filePathToNameConverter" />
        <lfsconv:FileSizeConverter x:Key="fileSizeConverter" />
        <lfsconv:MediaIconConverter x:Key="mediaIconConverter" />
    </UserControl.Resources>
    <Grid Margin="1,1,1,0" 
          MouseLeftButtonDown="Media_MouseLeftButtonDown"
          MouseRightButtonDown="Media_MouseRightButtonDown">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="75" />
        </Grid.ColumnDefinitions>
        
        <Grid Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="22" />
                <RowDefinition Height="16" />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0" Name="MediaNameGrid" Background="#FF555555">
                <Image Source="{Binding IconType, Converter={StaticResource mediaIconConverter}}" 
                       Stretch="None" 
                       Width="16" Height="16" 
                       HorizontalAlignment="Left"
                       VerticalAlignment="Center" />
                <TextBlock Name="MediaNameLabel"
                           Text="{Binding FilePath, Converter={StaticResource filePathToNameConverter}}" 
                           Background="{Binding IsSelected, Converter={StaticResource labelSelectionBackgroundBrushConverter}}"
                           Foreground="{Binding IsSelected, Converter={StaticResource labelSelectionForegroundBrushConverter}}" 
                           FontWeight="Bold" 
                           HorizontalAlignment="Left"
                           VerticalAlignment="Center"
                           Margin="20,0,0,0"/>

                <TextBox Name="MediaRenameBox" 
                         Width="140" Height="17" 
                         HorizontalAlignment="Left"
                         VerticalAlignment="Center"
                         Margin="20,0,0,0" Padding="0,0,0,-1"
                         MaxLength="60"
                         Visibility="Collapsed" />
            </Grid>

            <StackPanel Grid.Row="1" Orientation="Horizontal" Background="DarkGray">
                <TextBlock Text="{Binding FileSize, Converter={StaticResource fileSizeConverter}}" 
                           Foreground="Black"
                           Margin="2,0,0,5" FontSize="10" />
                <TextBlock Text="{Binding FileMTime}" 
                           Foreground="Black"
                           Margin="5,0,0,2" FontSize="10" />
            </StackPanel>

        </Grid>
        
        <Grid Name="MediaInfoGrid" Grid.Column="1" Background="#FFCACACA">
            
        </Grid>
    </Grid>
</UserControl>
